<script type="text/javascript" src="/js/cbrte/html2xhtml.min.js"></script>
<script type="text/javascript" src="/js/cbrte/richtext_compressed.js"></script>
<script type="text/javascript" src="/js/cbrte/init.js"></script>
<script type="text/javascript" src="/js/jquery-swapsies.js"></script>
<link rel="stylesheet" type="text/css" href="/js/admin/jquery/ui/themes/ui-lightness/jquery.ui.all.css" />

<script type="text/javascript">
	create_text_block("<?php echo $this->i;?>",'<?php echo $this->data;?>');
</script>

<div style="clear:both;	float:left;	width:100%;">
	<input type="button" style="float: right; margin: 10px; width: 60px;height: 30px; color:white; border: none; background-image: url('/images/btn_short.png');" value="Save" onclick = "save('<?php echo $this->i;?>');">
</div>

<script type="text/javascript">
function save(i)
{ 
	updateRTEs();
	var _data = encodeURIComponent(document.getElementById("hdntext"+i).value) ;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{	
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			window.parent.$.prettyPhoto.close();
			window.top.location.reload();
		}	
	};
	var url = "/admin/editor/saveblock?type=1&i=<?php echo $this->i;?>&data="+_data;
	xmlhttp.open("GET",url,true);	
	xmlhttp.send();
	return false;
}
</script>   